



function addButtons(){
	var $table = $('table');
	$table.find('thead > tr').append("<th>Barcode</th>");
	$table.find('tbody > tr').each(function(){
		sn = $(this).find('th > a').text()
		$(this).append('<td><a target="_blank" href="' + erpconfig.BARCODE_URL + '?serial=' + encodeURIComponent(sn) + '">' + sn + '</a></td>');
	});
}

	

$(document).ready(
	function() {
		var d = $(".addlink");
		if((d.length != 0) && (d.text() == "Add product")){
			addButtons();
		}

	}
);

